<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"	pageEncoding="UTF-8"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>

<div id="btGetBoxFeedBack" class="buttonOrange corner leftShadow">
	<a href="" title="">Góp ý</a>
</div>
<jsp:include page="boxFeedBack.jsp" />
<script type="text/javascript">
	$(document).ready(function(){
// 		var offTop = $(window).height()/2;
// 		var h = $("#btGetBoxFeedBack").height()/2;
// 		$("#btGetBoxFeedBack").css({
// 			top: (offTop - h) + 'px'
// 		});
		//gop y
		$("#btSubmitFeedBack").click(function(e){
			var email = $("#email").val();
			var contentFeedBack = $("#contentFeedBack").val();
			var answer = $("#answerFeedback").val();
			if(email != null && email != "" && contentFeedBack != null && contentFeedBack != "" && answer != null && answer != ""){
				$.ajax({
					type:"post",
					url:'<spring:url value="/gop-y.htm" />',
					data:({email:email,contentFeedBack:contentFeedBack,answer:answer}),
					async:false,
					success:function(rs){
						if(rs){
							$("#noticeFeebback").text("Cảm ơn bạn đã góp ý");
							$("#btSubmitFeedBack").hide();
						}else{
							$("#noticeFeebback").text("Có lẽ dữ liệu nhập vào chưa chính xác");
						}
					}
				});
			}
			e.preventDefault();
			return false;
		});
	});
</script>